/**
 * 
 */
package com.pmsco.pms.services.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.pmsco.pms.core.dao.PmsPermissionRoleDao;
import com.pmsco.pms.core.domain.PmsPermissionRole;
import com.pmsco.pms.services.interfaces.PmsPermissionRoleService;

/**
 * @author Tran Thanh Long
 *
 */
public class PmsPermissionRoleServiceImpl implements PmsPermissionRoleService {
private static final Logger logger = LoggerFactory.getLogger(PmsPermissionRoleServiceImpl.class);
	
	private static PmsPermissionRoleDao pmsPermissionRoleDao;
	
	public void saveOrUpdatePmsPermissionRole(PmsPermissionRole pmsPermissionRole) {
		pmsPermissionRoleDao.saveOrUpdatePmsPermissionRole(pmsPermissionRole);
	}

	public List<PmsPermissionRole> listPmsPermissionRole(PmsPermissionRole searchTemplate) {
		return pmsPermissionRoleDao.listPmsPermissionByRole(searchTemplate);
	}

	public List<PmsPermissionRole> loadPmsPermissionRoleByPermissionId(Long permissionId) {
		return pmsPermissionRoleDao.loadPmsPermissionRoleByPermissionId(permissionId);
	}

	public List<PmsPermissionRole> loadPmsPermissionRoleByName(String name) {
		return pmsPermissionRoleDao.loadPmsPermissionRoleByName(name);
	}

	public PmsPermissionRole loadPmsPermissionRole(PmsPermissionRole searchTemplate) {
		return pmsPermissionRoleDao.loadPmsPermissionRole(searchTemplate);
	}

	public void deletePmsPermissionRole(PmsPermissionRole pmsPermissionRole) {
		pmsPermissionRoleDao.deletePmsPermissionRole(pmsPermissionRole);
	}

	/**
	 * @param pmsPermissionRoleDao the pmsPermissionRoleDao to set
	 */
	public void setPmsPermissionRoleDao(PmsPermissionRoleDao pmsPermissionRoleDao) {
		logger.info("Start setPmsPermissionRoleDao");
		logger.debug("PMS Permission Role Dao: " + pmsPermissionRoleDao);
		this.pmsPermissionRoleDao = pmsPermissionRoleDao;
		logger.info("End setPmsPermissionRoleDao");
	}
}
